package com.chenjia.proto.converter.demo;

import com.chenjia.proto.converter.annotation.ProtoClass;
import com.chenjia.proto.converter.demo.message.RecommendGoods;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
@ProtoClass
@com.vova.rec.protobuf.converter.annotation.ProtoClass(RecommendGoods.class)
public class Goods {
    private int goodsId;
    private float catId;
    private String goodsSn;
    private long brandId;
    private double shopPrice;
    private boolean shippingFee;
    private int firstCatId;
    private int merchantId;

    private MerchantPojo merchant;
    private Map<Integer, MerchantPojo> merchants;
    private List<Integer> counts;

    public static Goods of() {
        Goods goods = new Goods();
        goods.setGoodsId(111);
        goods.setCatId(2);
        goods.setBrandId(3);
        goods.setGoodsSn("sn89289123");
        goods.setShopPrice(12.2);
        goods.setShippingFee(true);
        goods.setFirstCatId(1);
        goods.setMerchantId(333);
        goods.setMerchant(new MerchantPojo(1, "pdd", 5));
        List<Integer> counts = new ArrayList<>(2);
        counts.add(5);
        counts.add(2);
        goods.setCounts(counts);
        Map<Integer, MerchantPojo> map = new HashMap<>(4);
        map.put(10, new MerchantPojo(10, "pdd1", 5));
        map.put(13, new MerchantPojo(13, "vova", 3));
        goods.setMerchants(map);
        return goods;
    }
}
